package com.nbsaas.boot.store.rest.convert;

import com.nbsaas.boot.store.data.entity.StoreStaff;
import com.nbsaas.boot.store.api.domain.simple.StoreStaffSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* -列表对象转换器
*/

public class StoreStaffSimpleConvert implements Converter<StoreStaffSimple, StoreStaff> {




@Override
public StoreStaffSimple convert(StoreStaff source) {
    StoreStaffSimple result = new StoreStaffSimple();


               try {
                   if(source.getShop()!=null){
                       result.setShop(source.getShop().getId());
                   }
                } catch (Exception ignored) { }


                try {
                    if(source.getStaff()!=null){
                        result.setStaffName(source.getStaff().getName());
                    }
                } catch (Exception ignored) { }


                try {
                    if(source.getShop()!=null){
                        result.setShopName(source.getShop().getName());
                    }
                } catch (Exception ignored) { }


                try {
                    if(source.getStore()!=null){
                        result.setStoreName(source.getStore().getName());
                    }
                } catch (Exception ignored) { }


               try {
                   if(source.getStaff()!=null){
                       result.setStaff(source.getStaff().getId());
                   }
                } catch (Exception ignored) { }


               try {
                   if(source.getStore()!=null){
                       result.setStore(source.getStore().getId());
                   }
                } catch (Exception ignored) { }

                result.setId(source.getId());
                result.setAddDate(source.getAddDate());
                result.setLastDate(source.getLastDate());


    return result;
}

}